package com.jl.dao;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.sun.xml.internal.ws.api.message.Header;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.ArrayHandler;

import javax.sql.DataSource;
import java.sql.SQLException;

public class CheckDao {
    public Object[] isSaveData(String username) throws SQLException {
        DataSource dataSource = new ComboPooledDataSource();
        QueryRunner queryRunner = new QueryRunner(dataSource);
        String find = "select * from customer where username = '" + username + "'";
        Object[] query = queryRunner.query(find, new ArrayHandler());
        System.out.println(query);
        return query;
    }
}
